package com.t5;

/**
 * Created by xuyiwei on 2018/7/14.
 */
public class T_5_2 {

    static void printSon(Son s){
        System.out.println("son:"+s.getS());
    }

    static void printParent(Parent p){
        System.out.println("parent:"+p.getS());
    }

    public static void main(String[] args) {
        Son son = new Son();
        Parent parent = new Parent();
        printSon(parent);

        printParent((Parent) son);
    }

}
